package org.eenie.cartoonist.widget;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.FrameLayout;
import android.widget.ListView;

import org.eenie.cartoonist.R;

/**
 * Created by Eenie on 2016/8/23 17:47.
 * Des：
 */

public class MultiLevelView extends FrameLayout {

    private Context mContext;

    private ListView firstList;
    private ListView secondList;
    private ListView thirdList;

    private MultiLevelItemAdapter firstAdapter;
    private MultiLevelItemAdapter secondAdapter;
    private MultiLevelItemAdapter thirdAdapter;

    public MultiLevelView(Context context) {
        this(context, null);
    }

    public MultiLevelView(Context context, AttributeSet attrs) {
        super(context, attrs);
        init(context);

    }


    private void init(Context context) {
        this.mContext = context;
        LayoutInflater.from(mContext).inflate(R.layout.multi_level_view, this);
        firstList = (ListView) findViewById(R.id.firstList);
        secondList = (ListView) findViewById(R.id.secondList);
        thirdList = (ListView) findViewById(R.id.thirdList);
        firstAdapter = new MultiLevelItemAdapter(context);
        secondAdapter = new MultiLevelItemAdapter(context);
        thirdAdapter = new MultiLevelItemAdapter(context);
        firstList.setAdapter(firstAdapter);
        secondList.setAdapter(secondAdapter);
        thirdList.setAdapter(thirdAdapter);
    }
}
